<form class="layui-form layui-form-pamel" name="form1" id="form1" method="post">
    <div class="searchbox demoTable" id="searchbox">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">编码：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" maxlength="50" name="code" id="code" placeholder="请输入编码"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">类型：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" maxlength="50" name="type" id="type" placeholder="请输入类型"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">编码值：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" maxlength="50" name="codename" id="codename"
                           placeholder="请输入编码值"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">类型名称：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" maxlength="50" name="typename" id="typename"
                           placeholder="请输入类型名称"/>
                </div>
            </div>
            <input type="button" value="查询" onclick="$.table.search()" class="layui-btn layui-btn-red"/>
        </div>
    </div>
</form>

<div style="overflow:auto;width: 100%;padding-bottom: 20px;">
    <table id="simple-table" class="layui-table" lay-filter="simple-table">
    </table>
    <script type="text/html" id="barTable">
        <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="detailsFlag" title="详情">详情</a>
        <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="editFlag" title="编辑">编辑</a>
        <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="delFlag" title="删除">删除</a>
    </script>

    <script type="text/html" id="toolbarTable">
        <div class="layui-inline" title="添加" lay-event="addFlag"><i class="layui-icon layui-icon-add-circle"></i></div>
        <div class="layui-inline" title="导出" lay-event="exportExcel"><i class="layui-icon layui-icon-export"></i></div>
    </script>
</div>


<script type="text/javascript">

    var prefix = basePath + "system/dict";

    var options = {
        id: 'simple-table',
        url: prefix + '/dictlistPage',
        javaField: 'dictid',    //主键
        addUrl: prefix + '/addDict',   //添加
        deleteUrl: prefix + '/deleteDict',    //删除
        editUrl: prefix + '/toEditDict?dictid=',   //编辑
        exportUrl: prefix + '/exportDict',    //导出
        importTemplate: prefix + '/impTempDict',   //下载导入模板
        importTemplateUrl: prefix + '/impTempDictUrl',    //导入
        addFull: false, //弹出框最大化
        editFull: false, //弹出框最大化
        toolbar: '#toolbarTable',  //开启工具栏
        modalName: '数据字典',
        cols: [[
            {type: 'numbers', title: '序号', width: 50}
            , {field: 'code', title: '编码'}
            , {field: 'type', title: '类型'}
            , {field: 'codename', title: '编码值'}
            , {field: 'typename', title: '类型名称'}
            , {field: 'dictid', title: 'ID'}
            , {title: '操作', width: 178, align: 'center', toolbar: '#barTable'}
        ]],
        page: true
    };

    var init = $.table.init(options);

</script>
